# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Analytics.V3.Model.EntityUserLink do
  @moduledoc """
  JSON template for an Analytics Entity-User Link. Returns permissions that a user has for an entity.

  ## Attributes

  *   `entity` (*type:* `GoogleApi.Analytics.V3.Model.EntityUserLinkEntity.t`, *default:* `nil`) - Entity for this link. It can be an account, a web property, or a view (profile).
  *   `id` (*type:* `String.t`, *default:* `nil`) - Entity user link ID
  *   `kind` (*type:* `String.t`, *default:* `analytics#entityUserLink`) - Resource type for entity user link.
  *   `permissions` (*type:* `GoogleApi.Analytics.V3.Model.EntityUserLinkPermissions.t`, *default:* `nil`) - Permissions the user has for this entity.
  *   `selfLink` (*type:* `String.t`, *default:* `nil`) - Self link for this resource.
  *   `userRef` (*type:* `GoogleApi.Analytics.V3.Model.UserRef.t`, *default:* `nil`) - User reference.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :entity => GoogleApi.Analytics.V3.Model.EntityUserLinkEntity.t() | nil,
          :id => String.t() | nil,
          :kind => String.t() | nil,
          :permissions => GoogleApi.Analytics.V3.Model.EntityUserLinkPermissions.t() | nil,
          :selfLink => String.t() | nil,
          :userRef => GoogleApi.Analytics.V3.Model.UserRef.t() | nil
        }

  field(:entity, as: GoogleApi.Analytics.V3.Model.EntityUserLinkEntity)
  field(:id)
  field(:kind)
  field(:permissions, as: GoogleApi.Analytics.V3.Model.EntityUserLinkPermissions)
  field(:selfLink)
  field(:userRef, as: GoogleApi.Analytics.V3.Model.UserRef)
end

defimpl Poison.Decoder, for: GoogleApi.Analytics.V3.Model.EntityUserLink do
  def decode(value, options) do
    GoogleApi.Analytics.V3.Model.EntityUserLink.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Analytics.V3.Model.EntityUserLink do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
